#ifndef __FILEOP_H__
#define __FILEOP_H__

#include <stdlib.h>
#include <stdio.h>

/* no input check! */
#define GET_FILE_SIZE(file, size_of_file) do {   \
	fseek(file, 0, SEEK_END);		\
	size_of_file = ftell(file);		\
	fseek(file, 0, SEEK_SET);		\
	} while (0)

#define LEAVE_CLOSE(file, status) do { \
if (file) fclose(file); return status; } while(0)


#define LEAVE_FREE(pt, status) do { \
 if (pt) free(pt) ; return status;} while(0)


#endif //__FILEOP_H__